<div class="content-wrapper">
    <?php
    $form = $this->form;
    $form->prepare();
    ?>
    <?php echo $this->form()->openTag($form); ?>
    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right" id="dbshop-menu-top">
            <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?php echo $this->translate('保存设置'); ?></button>
            <?php echo $this->HelpUrl('phoneMessage'); ?>
        </h1>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab"><?php echo $this->translate('管理员提醒'); ?></a></li>
                        <li><a href="#tab_2" data-toggle="tab"><?php echo $this->translate('订单提醒'); ?></a></li>
                        <li><a href="#tab_3" data-toggle="tab"><?php echo $this->translate('其他提醒'); ?></a></li>
                    </ul>
                    <div class="tab-content">
                        <?php echo $this->partial('layout/messages'); ?>
                        <div class="tab-pane active" id="tab_1">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('管理员手机号码'); ?></label>
                                    <?php if(count($this->phoneArea) == 1) { ?>
                                        <div class="col-sm-3">
                                            <?php echo $this->formElement($form->get('areaCode')); ?>
                                            <?php echo $this->formElementErrors($form->get('areaCode'), ['class'=>'error-message']); ?>
                                            <?php echo $this->formElement($form->get('adminPhone')); ?>
                                            <?php echo $this->formElementErrors($form->get('adminPhone'), ['class'=>'error-message']); ?>
                                        </div>
                                    <?php } else { ?>
                                        <div class="col-sm-2">
                                            <?php echo $this->formElement($form->get('areaCode')); ?>
                                            <?php echo $this->formElementErrors($form->get('areaCode'), ['class'=>'error-message']); ?>
                                        </div>
                                        <div class="col-sm-3">
                                            <?php echo $this->formElement($form->get('adminPhone')); ?>
                                            <?php echo $this->formElementErrors($form->get('adminPhone'), ['class'=>'error-message']); ?>
                                        </div>
                                    <?php } ?>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('接收短信'); ?></label>
                                    <div class="col-sm-6">
                                        <?php echo $this->formElement($form->get('adminPhoneSend')); ?>
                                        <?php echo $this->formElementErrors($form->get('adminPhoneSend'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="tab_2">
                            <div class="box-body">
                                <div class="alert alert-info alert-dismissible">
                                    <?php if($this->smsConfig['sms_service_provider'] == 'aliSms') { ?>目前官方提供的可设置标签有 ${buyName} 购买人、${orderSn} 订单编号、${orderTotal} 订单金额、${deliveryName} 快递名称、${expressNumber} 快递单号<?php } ?>
                                    <?php if($this->smsConfig['sms_service_provider'] == 'huyiSms') { ?>目前官方提供的可设置标签有 {buyName} 购买人、{orderSn} 订单编号、{orderTotal} 订单金额、{deliveryName} 快递名称、{expressNumber} 快递单号。<br>互亿短信服务已内置模板，模板ID只需要填写1，不为空即是启用。<?php } ?>
                                    <?php if($this->smsConfig['sms_service_provider'] == 'tencentSms') { ?>目前官方提供的可设置标签有 {1} 购买人、{2} 订单编号、{3} 订单金额、{4} 快递名称、{5} 快递单号<?php } ?>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('订单提交模板ID'); ?></label>
                                    <div class="col-sm-3">
                                        <?php echo $this->formElement($form->get('addOrderSmsTemplateId')); ?>
                                        <?php echo $this->formElementErrors($form->get('addOrderSmsTemplateId'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('订单付款模板ID'); ?></label>
                                    <div class="col-sm-3">
                                        <?php echo $this->formElement($form->get('paymentOrderSmsTemplateId')); ?>
                                        <?php echo $this->formElementErrors($form->get('paymentOrderSmsTemplateId'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('订单发货模板ID'); ?></label>
                                    <div class="col-sm-3">
                                        <?php echo $this->formElement($form->get('shipOrderSmsTemplateId')); ?>
                                        <?php echo $this->formElementErrors($form->get('shipOrderSmsTemplateId'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('订单收货模板ID'); ?></label>
                                    <div class="col-sm-3">
                                        <?php echo $this->formElement($form->get('receiptOrderSmsTemplateId')); ?>
                                        <?php echo $this->formElementErrors($form->get('receiptOrderSmsTemplateId'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('订单取消模板ID'); ?></label>
                                    <div class="col-sm-3">
                                        <?php echo $this->formElement($form->get('cancelOrderSmsTemplateId')); ?>
                                        <?php echo $this->formElementErrors($form->get('cancelOrderSmsTemplateId'), ['class'=>'error-message']); ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="tab_3">
                            <div class="box-body">
                                <div class="alert alert-info alert-dismissible">
                                    <?php echo $this->translate('用户 注册、登录 验证码，除了启用 短信服务，还需要在 客户设置 勾选 手机号码和手机验证码。互亿短信服务已内置模板，模板ID只需要填写1，不为空即是启用。'); ?>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('验证码模板ID'); ?></label>
                                    <div class="col-sm-3">
                                        <?php echo $this->formElement($form->get('captchaSmsTemplateId')); ?>
                                        <?php echo $this->formElementErrors($form->get('captchaSmsTemplateId'), ['class'=>'error-message']); ?>
                                    </div>
                                    <p class="form-control-static small">
                                        <?php if($this->smsConfig['sms_service_provider'] == 'aliSms') { ?>${code} 验证码<?php } ?>
                                        <?php if($this->smsConfig['sms_service_provider'] == 'huyiSms') { ?>{code} 验证码<?php } ?>
                                        <?php if($this->smsConfig['sms_service_provider'] == 'tencentSms') { ?>{1} 验证码<?php } ?>
                                    </p>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><?php echo $this->translate('后台余额变更模板ID'); ?></label>
                                    <div class="col-sm-3">
                                        <?php echo $this->formElement($form->get('balanceSmsTemplateId')); ?>
                                        <?php echo $this->formElementErrors($form->get('balanceSmsTemplateId'), ['class'=>'error-message']); ?>
                                    </div>
                                    <p class="form-control-static small">
                                        <?php if($this->smsConfig['sms_service_provider'] == 'aliSms') { ?>${userName} 客户名称、${changeTime} 变动时间、${changeAmountType} 变动类型、${changeUserAmount} 变动金额、${userAmount} 变动后总额<?php } ?>
                                        <?php if($this->smsConfig['sms_service_provider'] == 'huyiSms') { ?>需自行添加 短信模板。<?php } ?>
                                        <?php if($this->smsConfig['sms_service_provider'] == 'tencentSms') { ?>{1} 客户名称、{2} 变动时间、{3} 变动类型、{4} 变动金额、{5} 变动后总额<?php } ?>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <?php echo $this->form()->closeTag(); ?>
</div>